// Author: dolphinigle
// 28 March 2012

function PutCommentCount(id) {
  // Ajax
  
  xmlhttp=new XMLHttpRequest();
  xmlhttp.open("GET",
               "comment_query.php?t=" + Math.random() + "&type=countall" +
               "&id=" + id,
               false);
  xmlhttp.send();
  
  document.getElementById("comments_count").innerHTML = xmlhttp.responseText;
}

function DeleteCommentClicked(id, pageid) {
  // Ajax
  
  xmlhttp=new XMLHttpRequest();
  xmlhttp.open("GET",
               "comment_modify.php?t=" + Math.random() + "&type=delete" +
               "&id=" + id,
               false);
  xmlhttp.send();
  $result = xmlhttp.responseText;
  
  document.getElementById("comment" + id).innerHTML = '';
  
  PutCommentCount(pageid);
}
